<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>王者荣耀-英雄选择</title>
    <link rel="stylesheet" href="/src/assets/index.css" />
    <!-- 在html中, 尽量使用 相对路径 -->
    <script src="./node_modules/vue/dist/vue.global.js"></script>
    <script src="./node_modules/axios/dist/axios.min.js"></script>
    <script src="./node_modules/lodash/lodash.min.js"></script>
  </head>
  <body>
    <div id="app">
      <div class="container">
        <!-- 上面搜索部分 -->
        <div class="search">
          <div class="title">
            <p>综合</p>
            <p>定位</p>
          </div>
          <div class="types">
            <div class="type-list" v-for="(arr, key) in typeList">
              <div
                class="radio"
                v-for="(item, index) in arr"
                @click="changeType(key, item.value)"
                :class="{checked: query.value == item.value}"
              >
                {{item.name}}
              </div>
            </div>
          </div>
          <div class="keyword">
            <div class="input">
              <input
                type="text"
                placeholder="请输入你要搜索的英雄名"
                :value="keyword"
                @input="changeKeyword"
              />
            </div>
          </div>
        </div>

        <!-- 下面列表展示部分 -->
        <ul class="list">
          <li v-for="hero in filterHeros" :key="hero.ename">
            <a :href="heroDetail(hero.ename)" target="_blank">
              <img :src="heroImage(hero.ename)" />
              <span v-html="hero.cname"></span>
            </a>
          </li>
        </ul>
      </div>
    </div>

    <script src="./src/js/index.js"></script>
  </body>
</html>
